package com.szsky.sky.controller;

import com.szsky.sky.dto.AttendanceStatisticsDto;
import com.szsky.sky.dto.AttendanceStatisticsQuery;
import com.szsky.sky.dto.BasicPersonnelInformationDto;
import com.szsky.sky.service.BasicPersonnelInformationService;
import com.szsky.sky.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 齐行
 * @version 1.0
 * @description: TODO
 * @date 2025/6/17 11:17
 */

@RestController
public class BasicPersonnelInformationController {

    @Autowired
    private BasicPersonnelInformationService basicPersonnelInformationService;


    @RequestMapping("/changeDepartment")
    public Result<Integer> changeDepartment(@RequestBody BasicPersonnelInformationDto basicPersonnelInformationDto){

        return basicPersonnelInformationService.changeDepartment(basicPersonnelInformationDto);

    }

    @GetMapping("/checkMobileOrEmail")
    public Result<Boolean> checkMobileOrEmail(@RequestParam(value = "mobile",required = false) String mobile, @RequestParam(value = "email",required = false) String email){
        return basicPersonnelInformationService.checkMobileOrEmail(mobile,email);
    }

    @PostMapping("/attendanceStatistics")
    public Result<List<AttendanceStatisticsDto>> AttendanceStatistics(@RequestBody AttendanceStatisticsQuery query){
        return basicPersonnelInformationService.attendanceStatistics(query);
    }

    @PostMapping("/synchronousZeroTrust")
    public Result<Boolean> synchronousZeroTrust(@RequestBody List<String> ids){
        return  basicPersonnelInformationService.synchronousZeroTrust(ids);
    }

    @PostMapping("/cancelSecondment")
    public Result<Boolean> cancelSecondment(@RequestBody List<BasicPersonnelInformationDto> dtoList){
        return  basicPersonnelInformationService.cancelSecondment(dtoList);
    }

    @PostMapping("/addSecondment")
    public Result<Boolean> addSecondment(@RequestBody List<BasicPersonnelInformationDto> list){
        return  basicPersonnelInformationService.addSecondment(list);
    }

}
